﻿<@override name="head">	
<title>编辑菜单</title>
<script type="text/javascript" src="${ctx}/assets/js/common/validate.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/back/resources.js"></script>
</@override>	
<@override name="body">
<div id=content_bg>
<#include "/main/home/common.ftl"/>
	<div id= "pagecontent">
		<div id="content">
	   		<div id="navDiv">
				<ul id="navDiv_ul">
					<li><i class="icon-home"></i></li>
					<li><a href="${ctx}/back/main/dashboard">首页</a></li>
					<li><i class="icon-angle-right"></i></li>
					<li><a href="${ctx}/back/main/resources/list">菜单管理</a></li>
					<li><i class="icon-angle-right"></i></li>
					<li class="navDiv_currentLi">编辑菜单</li>
				</ul>  
	 		</div>
	 		<form id="validateForm" action="${ctx}/back/main/resources/save" method="post" onsubmit="return toVaild()">
	 			<#if resourceList ??>
				<#list resourceList as resource>
		 			<input type="hidden" name="id" id="id" value=${resource.id!}>
		 			
					<div class="input-group">
						<label class="input-label"><span class="lbl-yes">*</span>菜单名称：</label>
						<input class="input-text" name="name" tabindex="1" value=${resource.name!}><span class="spanVaildate"></span>
					</div>
					<div class="input-group">
						<label class="input-label"><span class="lbl-yes">*</span>菜单标识：</label>
						<input class="input-text" name="resKey" tabindex="1" value=${resource.resKey!}><span class="spanVaildate"></span>
					</div>
					<div class="input-group">
						<label class="input-label"><span class="lbl-yes">*</span>菜单url：</label>
						<input class="input-text" name="resUrl" tabindex="1" value=${resource.resUrl!}><span class="spanVaildate"></span>
					</div>
					<div class="input-group">
						<label class="input-label"><span class="lbl-yes">*</span>菜单描述：</label>
						<input class="input-text" name="description" tabindex="1" value=${resource.description!}><span class="spanVaildate"></span>
					</div>
					<div class="input-group">
						<label class="input-label parentId"><span class="lbl-yes">*</span>上级菜单：</label>
						<select  name="parentId" >
						<option value =1010>顶级目录</option>
						<#if resourcesList ??>
					    <#list resourcesList as resources>  
					    
						        <#if resources.id==resource.parentId>
						       		<option value =${resources.id!} selected = "selected" >${resources.name!}</option>
						        <#else>
						        	<option value =${resources.id!}>${resources.name!}</option>
						        </#if> 
						       
						         <#if resources.children ??>
							     <#list resources.children as resourceschildren>
								     <#if resourceschildren.id==resource.parentId>
								    	 <option value =${resourceschildren.id!} selected = "selected" style="margin-left:30px">${resourceschildren.name!}</option>
								  	 <#else>
								  	 	<option value =${resourceschildren.id!} style="margin-left:30px">${resourceschildren.name!}</option>
								     </#if> 
								     
								     <#if resourceschildren.children ??>
							  	    <#list resourceschildren.children as resourceschildren_c>
							  	    	<#if resourceschildren_c.id==resource.parentId>
							  	    	<option value =${resourceschildren_c.id!} selected = "selected" style="margin-left:60px">${resourceschildren_c.name!}</option>
							  	   		<#else>
								  	 	<option value =${resourceschildren_c.id!} style="margin-left:60px">${resourceschildren.name!}</option>
								     </#if> 
							  	    </#list>
							        </#if> 
							     
					         	 </#list>
								 </#if>  
					        
						  </#list>
						  </#if> 
						</select>
				</div>
				<div class="input-group">
					<label class="input-label"><span class="lbl-yes">*</span>菜单类型：</label>
					<select  name="type" >
					
					  <#if resource.type=="0">
					  	<option value ="0" selected="selected">目录</option>
					  <#else>
					  	<option value ="0" >目录</option>
					  </#if>
					  
					  <#if resource.type=="1">
					  	<option value ="1" selected="selected">菜单</option>
					  <#else>
					  	<option value ="1" >菜单</option>
					  </#if>
					  <#if resource.type=="2">
					  	<option value ="2" selected="selected">按钮</option>
					  <#else>
					  	<option value ="2" >按钮</option>
					  </#if>
					  
					</select>
				</div>
				</#list>
				</#if> 
				<div id="footBtn">
					<button class="btn-save" type="submit">保存</button>
					<button class="btn-cancel" id="btn-cancel-authority" type="button">取消</button>
				</div>
			</form>
		</div>
    </div>
</div>
</@override>
<@extends name="/common/simple.ftl"/>